<template>
  <div class="banner">
    <div class="banner-img" @click="showImgSwiper">
      <img src="../../../../static/img/banner1.png" />
    </div>
    <div class="banner-title">金海湖风景区(AAAA景区)</div>

    <div class="img-swiper" v-show="imgSwiper" @click="hideImgSwiper">
      <swiper :options="swiperOption">
        <swiper-slide v-for="item in imgList" :key="item.id">
          <img :src="item.url" />
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
  export default{
    data(){
      return{
        swiperOption:{

        },
        imgList:[
          {id:1,url:require('../../../../static/img/banner1.png')},
          {id:2,url:require('../../../../static/img/banner1.png')},
          {id:3,url:require('../../../../static/img/banner1.png')}
        ],
        imgSwiper:false
      }
    },
    methods:{
      showImgSwiper(){
        this.imgSwiper=true
      },
      hideImgSwiper(){
        this.imgSwiper=false
      }
    }
  }
</script>

<style scope>
  .banner{
    position: relative;
  }
  .banner-img{
    width: 100%;
    overflow: hidden;
    height: 0;
    padding-bottom: 55%;
  }
  .banner-img img{
    width: 100%;
  }
  .banner-title{
    position: absolute;
    bottom: .4rem;
    left: .3rem;
    font-size: .36rem;
    color: #fff;
  }
  .img-swiper{
    background-color: #000;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .img-swiper img{
    width: 100%;
  }
</style>
